home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1998 January: Mac OS SDK / Dev.CD Jan 98 SDK1.toast / Development Kits (Disc 1) / QuickDraw 3D / Samples / SampleCode / BoxMooV / sources / BoxPaint_menu.c < prev    next >
Encoding:
C/C++ Source or Header  |  1997-08-14  |  2.6 KB  |  139 lines  |  [TEXT/CWIE]

  1. /*  menu.c                                                                            
  2.  
  3.     This contains all the menu code.
  4.                                                                                     
  5.     Michael Bishop - August 21 1996                                                    
  6.     Nick Thompson
  7.     (c)1994-96 Apple computer Inc., All Rights Reserved                                
  8.  
  9. */
  10.  
  11. /* --------------------------------------------------------------------
  12. ** Includes
  13. */
  14.  
  15. #include <StandardFile.h>
  16. #include <Devices.h>
  17.  
  18. #include    "BoxPaint_menu.h"
  19. #include    "BoxPaint_utility.h"
  20. #include    "BoxMooV_window.h"
  21. #include    "BoxMooV_document.h"
  22. #include    "BoxPaint_main.h"
  23.  
  24. /* --------------------------------------------------------------------
  25. ** Global Variables
  26. */
  27.  
  28.  
  29. /* --------------------------------------------------------------------
  30. ** Local Functions
  31. */
  32.  
  33.  
  34. /*    --------------------------------------------------------------------
  35. **    Menu_Adjust
  36. **    Update the menus to reflect the current status of the App
  37. */
  38. void Menu_Adjust( void ) 
  39. {
  40.     WindowPtr    theWindow = FrontWindow();
  41.     
  42.     if (theWindow != NULL) {
  43.  
  44.     }
  45. }
  46.  
  47.  
  48. /*    --------------------------------------------------------------------
  49. **    Menu_HandleCommand
  50. **    Finds out what was selected and does something about it.
  51. */
  52. void Menu_HandleCommand(long menuResult)
  53. {
  54.     short                menuID;
  55.     short                menuItem;
  56.     Str255                daName;
  57.     
  58.  
  59.     short                numTypes = 1 ;
  60.     SFTypeList            myTypes = { '3DMF', 0 } ;
  61.     
  62.  
  63.     WindowPtr            theWindow = FrontWindow() ;
  64.             
  65.     menuID = Utility_HiWrd(menuResult);
  66.     menuItem = Utility_LoWrd(menuResult);
  67.     
  68.     switch ( menuID ) {
  69.         /*  */
  70.         /* --------------------------------------------------------------------------     */
  71.         /*  */
  72.         case mApple:
  73.             switch ( menuItem ) {
  74.  
  75.                 case iAbout:
  76.                     Main_DoAbout() ;    
  77.                     break ;
  78.                                 
  79.                 default:
  80.                     GetMenuItemText(GetMenuHandle(mApple), menuItem, daName);
  81.                     (void) OpenDeskAcc(daName);
  82.                     break;
  83.             }
  84.             break;
  85.         /* --------------------------------------------------------------------------     */
  86.         case mFile:
  87.             switch ( menuItem ) {
  88.             
  89.                 case iNew:
  90.                     Document_New() ;
  91.                     break ;
  92.                 
  93.                 case iOpen:
  94.                     Document_Open() ;
  95.                     break ;
  96.                     
  97.                 case iSave:                
  98.                     break ;
  99.                 
  100.                 case iSaveAs:
  101.                     break;                
  102.                 
  103.                 case iClose:
  104.                     Document_Delete( Document_GetFromWindow(theWindow) ) ;
  105.                     break ;
  106.                     
  107.                 case iQuit:
  108.                     gQuitFlag = true ;
  109.                     break;
  110.             }
  111.             break;
  112.             
  113.             
  114.         /* --------------------------------------------------------------------------     */
  115.         case mEdit:
  116.  
  117.             switch(menuItem)
  118.             {
  119.                 case iCut:
  120.                     break;
  121.                 case iCopy:
  122.                     break;
  123.                 case iPaste:
  124.                     break;
  125.                 case iClear:
  126.                     break;
  127.                 default:
  128.                     break;
  129.             }
  130.             break; 
  131.  
  132.         /* --------------------------------------------------------------------------     */
  133.  
  134.     }
  135.     HiliteMenu(0);        /*  Unhighlight whatever MenuSelect or MenuKey hilited */
  136. }
  137.  
  138.  
  139.